package com.dt.platform.generator.module.ops;

import com.dt.platform.constants.db.OpsTables;
import com.dt.platform.generator.config.Config;
import com.dt.platform.ops.page.TaskPageController;
import com.dt.platform.ops.page.TaskStepLogPageController;
import com.dt.platform.proxy.ops.TaskServiceProxy;
import com.dt.platform.proxy.ops.TaskStepLogServiceProxy;
import com.github.foxnic.generator.config.WriteMode;

public class TaskStepLogGtr extends BaseCodeGenerator{


    public TaskStepLogGtr() {
        super(OpsTables.OPS_TASK_STEP_LOG.$TABLE,"748459098852294661");
    }

    public void generateCode() throws Exception {
        System.out.println(this.getClass().getName());

        cfg.view().field(OpsTables.OPS_TASK_STEP_LOG.ID).table().hidden(true);
        cfg.view().field(OpsTables.OPS_TASK_STEP_LOG.ID).basic().hidden();

        cfg.view().field(OpsTables.OPS_TASK_STEP_LOG.CONTENT).search().fuzzySearch();

        cfg.view().search().inputLayout(
                new Object[]{
                        OpsTables.OPS_TASK_STEP_LOG.CONTENT,
                }
        );

        cfg.view().field(OpsTables.OPS_TASK_STEP_LOG.UPDATE_BY).table().disable(true);

        cfg.view().field(OpsTables.OPS_TASK_STEP_LOG.UPDATE_BY).table().disable(true);
        cfg.view().field(OpsTables.OPS_TASK_STEP_LOG.UPDATE_BY).table().disable(true);
        cfg.view().field(OpsTables.OPS_TASK_STEP_LOG.CREATE_BY).table().disable(true);
        cfg.view().field(OpsTables.OPS_TASK_STEP_LOG.TASK_STEP_ID).table().disable(true);
        cfg.view().field(OpsTables.OPS_TASK_STEP_LOG.TASK_ID).table().disable(true);

        cfg.view().field(OpsTables.OPS_TASK_STEP_LOG.CONTENT).form().textArea().height(300);
        cfg.view().search().labelWidth(1,Config.searchLabelWidth);
        cfg.view().search().labelWidth(2,Config.searchLabelWidth);
        cfg.view().search().labelWidth(3,Config.searchLabelWidth);
        cfg.view().search().labelWidth(4,Config.searchLabelWidth);
        cfg.view().search().inputWidth(Config.searchInputWidth);


        cfg.view().list().disableBatchDelete();



        cfg.view().formWindow().bottomSpace(60);
        cfg.view().formWindow().width(Config.baseFormWidth);
        cfg.view().form().addGroup(null,
                new Object[] {
                        OpsTables.OPS_TASK_STEP_LOG.CONTENT,
                }
        );


        cfg.view().list().addJsVariable("TASK_ID","[[${taskId}]]","TASK_ID");
        cfg.view().list().addJsVariable("TASK_STEP_ID","[[${taskStepId}]]","TASK_STEP_ID");



        //文件生成覆盖模式
        cfg.overrides()
                .setServiceIntfAnfImpl(WriteMode.COVER_EXISTS_FILE) //服务与接口
                .setControllerAndAgent(WriteMode.COVER_EXISTS_FILE) //Rest
                .setPageController(WriteMode.IGNORE) //页面控制器
                .setFormPage(WriteMode.COVER_EXISTS_FILE) //表单HTML页
                .setListPage(WriteMode.COVER_EXISTS_FILE)//列表HTML页
                .setExtendJsFile(WriteMode.IGNORE); //列表HTML页
        //生成代码
        cfg.buildAll();
    }

    public static void main(String[] args) throws Exception {
        TaskStepLogGtr g=new TaskStepLogGtr();
        //生成代码
        g.generateCode();
        //移除之前生成的菜单，视情况执行
        //g.removeByBatchId("478921035245158400");
      // g.generateMenu(TaskStepLogServiceProxy.class, TaskStepLogPageController.class);
    }
}
